package net.cmkj.mine.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import net.cmkj.mine.util.SessionKit;

public class SessionInterceptor implements Interceptor {

    @Override
    public void intercept(Invocation inv) {
        SessionKit.put(inv.getController().getSession(true));
        try {
            inv.invoke();
        } finally {
            SessionKit.remove();
        }
    }

}
